package cn.sw.api.system.user;

import cn.sw.api.system.config.EmptyFeignConfig;
import cn.sw.api.system.config.UserFeignConfig;
import cn.sw.common.database.domain.dto.form.UserFormDto;
import cn.sw.common.database.domain.dto.query.UserQueryDto;
import cn.sw.common.database.domain.entity.User;
import cn.sw.common.http.HttpResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient(name = "cloud-system", contextId = "userid")
@RequestMapping("/user")
public interface UserApi {

    @GetMapping("/RById/{id}")
    HttpResponse<User> RById(@PathVariable("id") String id);

    @PostMapping("/R")
    HttpResponse<List<User>> R(@RequestBody UserQueryDto query);

    @PostMapping("/C")
    HttpResponse<?> C(@RequestBody UserFormDto form);

    @PostMapping("/CBatch")
    HttpResponse<?> CBatch(@RequestBody List<UserFormDto> formList);

    @PostMapping("/UById")
    HttpResponse<?> UById(@RequestBody UserFormDto form);

    @PostMapping("/UBatchById")
    HttpResponse<?> UBatchById(@RequestBody List<UserFormDto> formList);

    @PostMapping("/COrU")
    HttpResponse<?> COrU(@RequestBody UserFormDto form);

    @PostMapping("/COrUBatch")
    HttpResponse<?> COrUBatch(@RequestBody List<UserFormDto> formList);

    @GetMapping("/DById/{id}")
    HttpResponse<?> DById(@PathVariable("id") String id);

    @PostMapping("/DByIds")
    HttpResponse<?> DByIds(@RequestBody List<String> idList);
}

